package com.evan.common.bit;

public enum NodeModeEnum {
    /**
     * LEADER
     */
    PERSISTENT("PERSISTENT","持久节点"),
    /**
     * FLOWER
     */
    EPHEMERAL("EPHEMERAL","临时节点"),
    ;
    private String val;
    private String msg;

    NodeModeEnum(String val, String msg){
        this.val = val;
        this.msg = msg;
    }

    public String getVal() {
        return val;
    }

    public void setVal(String val) {
        this.val = val;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    private String getString(){
        return this.val.toString();
    }
    public static NodeModeEnum getInstance(String val){
        for(NodeModeEnum buss: NodeModeEnum.values()){
            if(buss.getVal().equals(val)){
                return buss;
            }
        }
        return null;
    }
}
